package com.zjyd.douyangcommoncore.config;

import com.github.houbb.sensitive.word.bs.SensitiveWordBs;
import com.github.houbb.sensitive.word.support.deny.WordDenys;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 敏感词过滤
 */
@Configuration
public class SensitiveWordConfig {

    @Bean
    public SensitiveWordBs sensitiveWordBs(){
        return SensitiveWordBs.newInstance()
                .ignoreCase(true) //忽略大小写
                .ignoreWidth(true) //忽略全角办角
                .wordDeny(WordDenys.chains( //合并一下屏蔽词
                        WordDenys.defaults(), //系统
                        new MyWordDenyConfig()
                )) // 自定义屏蔽词
                .init();
    }
}
